
import type { FormRules } from 'element-plus'
import { reactive } from 'vue'
export const form = reactive({
  businesstype: '',
  companycode: '',
  sitecode: '',
  stationcode: '',
  groupcode: '',
  equipmenttype: '',
  equipmentname: '',
  address: '',
  vendor: '',
  model: '',
  installalocation: '',
  alarmmechan: ''
})

export const rules = reactive<FormRules>({
  businesstype: [{ required: true, message: '请选择业务类型' }],
  companycode: [{ required: true, message: '请选择企业' }],
  sitecode: [{ required: true, message: '请选择站点' }],
  stationcode: [{ required: true, message: '请选择电站' }],
  groupcode: [{ required: true, message: '请选择分组' }],
  equipmenttype: [{ required: true, message: '请选择设备类型' }],
  equipmentname: [{ required: true, message: '请输入设备名称' }],
  address: [{ required: true, message: '请输入设备地址' }],
  vendor: [{ required: true, message: '请输入设备厂商' }],
  model: [{ required: true, message: '请输入设备型号' }],
  installalocation: [{ required: true, message: '请输入安装位置' }],
  alarmmechan: [{ required: true, message: '请输入告警机制' }]
})
export const saveAdd = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const queryEdit = (id: string) => {
  console.log('id:==', id)
} 
export const saveEdit = (callback?: Function) => {
  typeof callback === 'function' && callback()
}
export const saveDel = (id: string, callback?: Function) => {
  console.log('id--:', id)
  typeof callback === 'function' && callback()
}
